package cn.golxen.rsms.commons.utils;

import com.show.api.ShowApiRequest;
import org.springframework.stereotype.Component;

@Component
public class BarcodeUtils {
    static String appid= YmlUtils.getString("barcode-api.appid");
    static String appSecret= YmlUtils.getString("barcode-api.app-secret");

    public String GetBarcode(String url){
        String res=new ShowApiRequest("http://route.showapi.com/2275-4",appid,appSecret)
                .addTextPara("image_url",url)
                .post();
        return res;
    }

    public static String GetGoodsInfo(String code){
        String res=new ShowApiRequest("http://route.showapi.com/66-22",appid,appSecret)
                .addTextPara("code",code)
                .post();
        return res;
    }
}
